import request from '@/utils/request'

// 获取组织架构的数据
export function getDepartmentsAPI() {
  return request({
    method: 'GET',
    url: '/company/department'
  })
}

// 封装删除功能接口

export function delDepartmentAPI(id) {
  return request({
    method: 'DELETE',
    url: `/company/department/${id}`
  })
}

// 封装新增功能接口
export function addDepartmentAPI(data) {
  return request({
    method: 'POST',
    url: '/company/department',
    data
  })
}

// 获取部门详情接口
export function getDepartmentDetailAPI(id) {
  return request({
    method: 'GET',
    url: `/company/department/${id}`
  })
}

// 封装保存编辑接口
export function updateDepartmentsAPI(data) {
  return request({
    method: 'PUT',
    url: `/company/department/${data.id}`,
    data
  })
}